//
//  LGHospitalPlanDetailContent.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/5/25.
//  通知内容

#import "LGHospitalPlanDetailContent.h"

@interface LGHospitalPlanDetailContent() 

/**   */
@property (nonatomic , strong)UIButton *titleBtn;
/**   */
@property (nonatomic , strong)UIView *lineView;
/**   */
@property (nonatomic , strong)UITextView *contentTF;

@end

@implementation LGHospitalPlanDetailContent

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.titleBtn];
        [self addSubview:self.lineView];
        [self addSubview:self.contentTF];
        [self.contentTF mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(viewPix(12));
            make.right.equalTo(self).offset(-viewPix(12));
            make.top.equalTo(self.lineView.mas_bottom).offset(viewPix(5));
            make.bottom.equalTo(self).offset(-viewPix(16));
        }];
    }
    return self;
}

-(void)setContent:(NSString *)content{
    _content = content;
    self.contentTF.text = content;
}

-(UIButton *)titleBtn{
    if(!_titleBtn){
        _titleBtn = [UIButton buttonWithTitle:@"通知内容" titleFont:LGFontWeight(16, UIFontWeightMedium) textColor:@"#333333" imageName:@"计划入院-通知内容"];
        _titleBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        _titleBtn.frame = CGRectMake(viewPix(12), 0, viewPix(100), viewPix(48));
        _titleBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 6, 0, 0);
    }
    return _titleBtn;
}

-(UIView *)lineView{
    if(!_lineView){
        _lineView = [[UIView alloc]initWithFrame:CGRectMake(viewPix(12), viewPix(48), Screen_W-viewPix(56), 1)];
        _lineView.backgroundColor = [UIColor colorWithString:@"#E8E8E8"];
    }
    return _lineView;
}

-(UITextView *)contentTF{
    if(!_contentTF){
        _contentTF = [[UITextView alloc]init];
        _contentTF.tintColor = [UIColor colorWithString:@"#333333"];
        _contentTF.textColor = [UIColor colorWithString:@"#333333"];
        _contentTF.textAlignment = NSTextAlignmentLeft;
        _contentTF.userInteractionEnabled = NO;
        _contentTF.font = LGFont(16);
//        _contentTF.delegate = self;
    }
    return _contentTF;
}


@end
